<!--
 * @Author: 谢陈洁
 * @Date: 2025-06-25 13:42:52
 * @LastEditors: 谢陈洁
 * @LastEditTime: 2025-07-14 10:07:42
 * @Description: file content
-->
<template>
  <el-card>
    <ProForm
      ref="formRef"
      :formItems="formItems"
      :showAction="false"
      :inline="true"
      labelWidth="auto"
    >
      <template #footer>
        <search-button type="primary" @click="onSearch">搜索</search-button>
        <reset-button @click="onReset">重置</reset-button>
      </template>
    </ProForm>
  </el-card>
</template>

<script setup lang="ts">
  import ProForm from './index.vue'
  import type { IFormItem } from './type'
  const emits = defineEmits(['search'])
  defineProps<{
    formItems: IFormItem[]
  }>()
  const formRef = ref()
  const onSearch = () => {
    console.log('formData', formRef.value.formData)
    emits('search', formRef.value.formData)
  }
  const onReset = () => {
    formRef.value.handleReset()
  }
</script>
